<template>
<div id="user1">
  用户组件1
<br/>
<!--  <v-actionsheet/>-->
  <br/>
<!--  点击的时候flag变为true，不点击的时候初始化是false-->
  <mt-button @click.native="flag=true" size="large">测试action-sheet</mt-button>
  <mt-actionsheet :actions="actions" v-model="flag" cancel-text="取消它"></mt-actionsheet>
</div>
</template>

<script>

import ActionSheet from "./ActionSheet";


export default {
name: "User1",
  data(){
      return {
        flag:false,actions:[]
      }
  },methods:{
    takePhoto(){
      alert("点击拍照")
    },openAlbum(){
        alert("点击从相册中选择")
    }
  },mounted() {
    this.actions = [{
      name: '拍照',
      method: this.takePhoto
    }, {
      name: '从相册中选择',
      method: this.openAlbum
    }];

  },components:{
      'v-actionsheet':ActionSheet
  }

}
</script>

<style scoped>

</style>
